import React from "react"
import {Button} from "antd"
// interface propsType{
//     list:object
// }
interface stateType{
    title:string;
}
interface CartType<T>{
    hobby:string[];
    sayHi(name:T):void
}
export default class Cart extends React.Component<any,stateType> implements CartType<string>{
    hobby:string[];
    constructor(props:any){
        super(props)
        this.hobby =["xx"],
        this.state = {
            title:"cart页面"
        }
    }
    sayHi(name: string): void {
        
    }
    render(){
        console.log(this.props);
        
        return(
            <fieldset>
                <legend>Cart</legend>
                <h1>购物车页面</h1>
                <h2>{this.state.title}</h2>
                <Button type="primary" onClick={()=>{
                    this.props.history.push("/home")
                }}>点击返回主页</Button>
            </fieldset>
        )
    }
}